/**
 * Created by szc on 2017/1/9.
 */
class LeftPanle extends egret.DisplayObjectContainer {

    private leftNum :number;
    private leftpanle :any;
    private numberPanel:NumPanel2;
    public constructor() {
        super();
        this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
    }
    private onAddToStage(event: egret.Event) {

        var image_bg = new eui.Image();
        image_bg.source = "has_kuang_png";
        image_bg.y = 0;
        image_bg.x = 0;
        image_bg.width = 376;
        image_bg.height = 100;
        image_bg.$setScaleX(0.6);
        image_bg.$setScaleY(0.6);
        this.addChild(image_bg);


        var image_top  = new eui.Image();
        image_top.source = "all_money_top_png";
        image_top.$setScaleX(0.6);
        image_top.$setScaleY(0.6);
        image_top.x = 85;
        image_top.y = -26 ;
        this.addChild(image_top);

        this.numberPanel = new NumPanel2(15 * 0.8, 22.5 * 0.8, "w_");
        this.numberPanel.x = 120;
        this.numberPanel.y = 30;
        this.addChild(this.numberPanel);
    }

    public setMoney(num:number):void{
        // this.leftNum = num;
        // var temp:number = num*100;
        // temp = parseInt(temp.toString())/100;
        // this.leftpanle.setNum(temp.toString());

        // this.leftpanle.x = (this.width - this.leftpanle.width) / 2 + this.leftpanle.width;
        this.numberPanel.setNum(num);
    }

    public getMoney():any{
        return this.numberPanel.getNum();
    }
}